package org.liu.lambda;

import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;

public class FunctionDemo {

    public static void main(String[] args) {
        Consumer<Integer> consumer = num -> System.out.println("单个消费" + num);
        consumer.accept(22);

        BiConsumer<Integer, Integer> biConsumer = (integer, integer2) -> System.out.println("binary消费 求和" + (integer + integer2));
        biConsumer.accept(10, 22);


        Function<Object, String> function = o -> "拿到了数据：" + o;
        String hello = function.apply(22222222);
        System.out.println("带返回值" + hello);

        Predicate<Integer> predicate = integer -> integer > 10;
        System.out.println("断言" + predicate.test(22));
    }
}
